/*
 * @Author: zhanglianchang
 * @Date: 2020-08-01 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:49:44
 *
 * 题库有关的接口：自己写吧~~  已经被张老师删了 ^_^
 */
import { createAPI } from '@/utils/request'

// 获取学科下拉列表数据-liqiushi
export const getSubjectIDBody = () => createAPI('/subjects/simple', 'get')
// 获取二级目录数据-liqiushi
export const getCatalogIDBody = params => createAPI(
  '/directorys/simple', 'get', 'params'
)
// 获取标签下拉列表-liqiushi
export const getTagsBody = params => createAPI(
  '/tags/simple', 'get', 'params'
)
// 获取数据列表-liqiushi
export const getRandomsList = params => createAPI(
  '/questions/choice', 'get', params
)
// 审核通过的请求-liqiushi
export const auditPass = data => createAPI(
  `/questions/check/${data.id}`, 'POST', data
)
// 根据需要在地址栏携带试题ID方可区分新增与修改  修改试题api-liqiushi
export const updateQuestion = data => createAPI(
  `/questions/${data.id}`, 'get', data
)
// 上架接口one--liqiushi
export const getOnTheShelfONE = data => createAPI(
  `/questions/choice/${data.id}/1`, 'POST', data
)
// 下架接口zero--liqiushi
export const getOnTheShelfZERO = data => createAPI(
  `/questions/choice/${data.id}/0`, 'POST', data
)
// 删除接口--liqiushi
export const deleteRandomsList = data => createAPI(
  `/questions/${data.id}`, 'DELETE', data
)
// 预览接口--liqiushi
export const updateQuestionPlus = data => createAPI(
  `/questions/${data.id}`, 'get', { id: data.id }
)
// 基础题库列表
export const list = data => createAPI('/questions', 'get', data)
// 删除题库
export const remove = data => createAPI(`/questions/${data.id}`, 'DELETE', data)
// 加入精选
export const choiceAdd = data => createAPI(`/questions/choice/${data.choiceState}/${data.id}`, 'PATCH', data)
// 点击预览功能
export const preview = data => createAPI(`/questions/${data.id}`, 'GET', data)

// 获取组题列表信息
export const getRoleList = data => createAPI(
  '/questions/randoms/',
  'get',
  data
)
// 删除组题列表信息
export const deleteRole = data => createAPI(
  `/questions/randoms/${data.id}`,
  'DELETE',
  data
)

// 获取具体学科数据
export const getQuestion = data => createAPI(`/questions/${data.id}`, 'get', data)
